{include file="public/header"}
<div class="index_html huanzheliebiao  jiluliebiao">

{include file="public/nav"}

<div class="list_box">
<div class="title">
    <p>记录列表</p>
</div>
    <form action="" method="get" ><!-- 下面是搜索  -->
<div class="top" style="padding: 0 0;">
    <!-- 开始日期 -->
    <div class="start_date">
        <script type="text/javascript">
            $(function(){
                $('.end_date_picker').date_input();
            })
        </script>
        <div style=" margin:50px auto; width:500px;">
            <input name="start" value="{$search['start']?? ''}" style="width:226px;background: #fefefe;border: 1px solid #bbb;font-size: 14px;color: #333;padding: 7px;border-radius: 3px;" type="text" class="end_date_picker" id="start_date">
        </div>
        <script>
            //创建一个当前日期对象
            var now = new Date();
            //格式化日，如果小于9，前面补0
            var day = ("0" + now.getDate()).slice(-2);
            //格式化月，如果小于9，前面补0
            var month = ("0" + (now.getMonth() + 1)).slice(-2);
            //拼装完整日期格式
            var today = now.getFullYear()+"-"+(month)+"-"+(day) ;
            //完成赋值
            //完成赋值
            var start = "{$search['start']|default=''}";
            if(start){
                today = start;
                $('#start_date').val(today);
            }

        </script>
    </div>
    <!-- 下面截止日期 -->
    <div class="end_date">
        <script type="text/javascript">
            $(function(){
                $('.date_picker').date_input();
            })
        </script>
        <div style=" margin:50px auto; width:500px;">
            <input name="end"  value="{$search['end']?? ''}" style="width:226px;background: #fefefe;border: 1px solid #bbb;font-size: 14px;color: #333;padding: 7px;border-radius: 3px;" type="text" class="date_picker" id="end_date">
        </div>
        <script>
            //创建一个当前日期对象
            var now = new Date();
            //格式化日，如果小于9，前面补0
            var day = ("0" + now.getDate()).slice(-2);
            //格式化月，如果小于9，前面补0
            var month = ("0" + (now.getMonth() + 1)).slice(-2);
            //拼装完整日期格式
            var today = now.getFullYear()+"-"+(month)+"-"+(day) ;
            //完成赋值
            var end = "{$search['end']|default=''}";
            if(end){
                today = end;
                $('#end_date').val(today);
            }

        </script>
    </div>
    <!-- 下面是搜索  -->
    <div class="new_box new_box_type" style="width: 120px !important;">
        <select name="patient_case_type" >

            <option value="">全部</option>

            {foreach name="case_select" item="vo"}
            <option value="{$vo['id']}" >{$vo['name']}</option>
            {/foreach}

        </select>

    </div>
    <!-- 下面是身份证 -->
    <div class="id_card" style="width: 160px !important;">
        <input type="text" name="name" value="{$search['name']?? ''}" placeholder="查找姓名或身份证号">
    </div>
    <!-- 下面是医生 -->
    <div class="doctor_id"  style="width: 160px !important;">
        <input type="text" name="doctor" value="{$search['doctor']?? ''}" placeholder="录入查找医生">
    </div>

    <input type="submit" value="搜索" class="sou_btn" style="position: static;width: 80px !important;height: 50px;margin-left: 0;color:#fff;padding: 0;">


</div>
    </form>
    {if condition="!$list->isEmpty()"}
<!--  列表的开始 -->
<div class="list">
    <div class="top_dec">
        <strong class="first" style="width: 80px;">检查编号</strong>
        <strong class="second">姓名</strong>
        <strong class="third">性别</strong>
        <strong class="forth">身份证号</strong>
        <strong class="fifth">年龄</strong>
        <strong class="sixth">类型</strong>
        <strong class="seventh">检查结果</strong>
        <strong class="eight">部位</strong>
        <strong class="nienth">检查时间</strong>
        <strong class="tenth">所属部门</strong>
        <strong class="eleventh">录入医生</strong>
    </div>
    <ul>
        {foreach $list as $vo}
        <li>
            <a href="{:url('record/check_detail',array('id'=>$vo['id']))}">
							<span class="first"  style="width:80px;overflow: hidden;">
								<em>{$vo['case_num']}</em>
							</span>
							<span class="second">
								<em>{$vo['patient_name']}</em>
							</span>
							<span class="third">
								<em>{$vo['sex']|get_sex_str}</em>
							</span>
							<span class="forth">
								<em>{$vo['document_num']}</em>
							</span>
							<span class="fifth">
								<em>{$vo['birth']|getAge}</em>
							</span>
							<span class="sixth">
								<em>{$vo['patient_case_type']}</em>
							</span>
							<span class="seventh">
								<em>{$vo['check_result']}</em>
							</span>
							<span class="eight">
								{foreach name="$vo['patient_part_lat']" item="svo"}
                                    {$svo['part'] ?? ''}/{$svo['lat']?? ''}
                                    <br>
                                    {/foreach}
							</span>
							<span class="nienth">
								{$vo['check_time']}
							</span>
							<span class="tenth">
								{$vo['department_name']}
							</span>
							<span class="eleventh">
								<em>{$vo['doctor_name']}</em>
							</span>
            </a>
        </li>
        {/foreach}


    </ul>
</div>
<!--  列表的结束 -->


    <!--------分页--------->
    {include file="public/page" /}
    <!--------分页--------->
    {else/}
    暂无记录
    {/if}
</div>
</div>

{include file="public/footer"}